<template>
  <div>
    <h1>生命周期钩子函数</h1>
  </div>
</template>

<script>
import { onMounted } from 'vue'
export default {
  mounted () {
    console.log('mounted')
  },
  setup () {
    /**
     * 1. vue3生命周期钩子函数优先级高
     * 2. 发请求或操作dom =》onMounted
     */
    onMounted(() => {
      console.log('onMounted1')
    })
    onMounted(() => {
      console.log('onMounted2')
    })
    return {}
  }
}
</script>

<style lang="scss" scoped>
</style>
